<?php

// +----------------------------------------------------------------------
// | 版权所有 2017-2027 云南环拓科技有限公司，并保留所有权利。
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2027 http://www.yn123.com All rights reserved.
// +----------------------------------------------------------------------
// | Notice: This code is not open source, it is strictly prohibited
// |         to distribute the copy, otherwise it will pursue its
// |         legal responsibility.
// | 注意：  这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用,
// |        不允许对程序代码以任何形式任何目的的再发布。
// +----------------------------------------------------------------------
// | Author: feraner <feraner@163.com> 
// | Date: 2019/11/1
// +----------------------------------------------------------------------

namespace app\index\controller;

use think\App;
use think\Db;

/**
 *
 * Class Jobs
 * @package app\index\controller
 * @author feraner<feraner@163.com>
 * @date 2019/11/1
 */
class Jobs extends UserBase
{


    public function __construct(App $app = null)
    {
        parent::__construct($app);
    }


    /**
     * 兼职列表
     * @return mixed
     * @throws \WeChat\Exceptions\InvalidResponseException
     * @throws \WeChat\Exceptions\LocalCacheException
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function index()
    {

        $jobType = $this->request->param('jobType', 0);

        $jobTypeInfo = Db::name('jobs_type')->where('id', $jobType)
            ->find() ?: [];

        $this->assignJsSign($this->request->url(true));

        $this->assign('jobTypeInfo', $jobTypeInfo);

        return $this->fetch();
    }


    /**
     * 兼职详情
     * @return mixed
     * @throws \WeChat\Exceptions\InvalidResponseException
     * @throws \WeChat\Exceptions\LocalCacheException
     */
    public function jobDetail()
    {
        $jobId = $this->request->param('id');
        $this->assign('jobId', $jobId);
        $this->assignJsSign($this->request->url(true));

        return $this->fetch();
    }


    /**
     * 发布兼职
     * @return mixed
     */
    public function addJob()
    {
        $jobId = $this->request->param('jobId', 0);

        $this->assign('jobId', $jobId);

        return $this->fetch();
    }


    /**
     *
     */
    public function applyUserList()
    {
        $jobId = $this->request->param('jobId', 0);

        $this->assign('jobId', $jobId);

        return $this->fetch();
    }





    /**
     * 审核兼职
     * @return mixed
     */
    public function auditJob()
    {
        $jobId = $this->request->param('id');
        $this->assign('jobId', $jobId);

        return $this->fetch();
    }







}
